Skip to contentSkip to conversation

set go buildid to empty for improving reproducibility

PATCH In review [email protected] 2 participants 20 messages Jan 8 – Jan 15

lore
Share & tools
lore
#0 lore raw

cover set go buildid to empty for improving reproducibility

From: Changqing Li <[email protected]>

These series of patches are mostly set buildid to empty for improving reproducibility, I also send a patch to oe-core with subject:
[PATCH V3] go.bbclass: set buildid to empty string to improve reproducibility

which add -buildid= in default GO_LDFLAGS, but since packages compiled with go may not use GO_LDFLAGS in go.bbclass, they can have their own Makefiles, define their own variables for passing ldflags, so change them one by one.

podman also disable buildvcs

Changqing Li (15):
docker-compose: set go buildid to empty for improving reproducibility
docker: set go buildid to empty for improving reproducibility
kubernetes: set go buildid to empty for improving reproducibility
nerdctl: set go buildid to empty for improving reproducibility
runc: set go buildid to empty for improving reproducibility
skopeo: set go buildid to empty for improving reproducibility
umoci: set go buildid to empty for improving reproducibility
cni: update GO_EXTRA_LDFLAGS
oci-image-tools: set go buildid to empty for improving reproducibility
docker-distribution: set go buildid to empty for improving
reproducibility
containerd: set go buildid to empty for improving reproducibility
cri-o: set go buildid to empty for improving reproducibility
cri-tools: set go buildid to empty for improving reproducibility
oci-runtime-tools: set go buildid to empty for improving
reproducibility
podman: improve reproducibility

 .../containerd/containerd_git.bb              |  1 +
 recipes-containers/cri-o/cri-o_git.bb         |  1 +
 recipes-containers/cri-tools/cri-tools_git.bb |  2 +-
 .../docker-compose/docker-compose_git.bb      |  4 +-
 .../docker-distribution_git.bb                |  2 +
 ...01-Makefile-remove-duplicate-ldflags.patch | 39 +++++++++++++++++++
 recipes-containers/docker/docker.inc          |  2 +
 .../kubernetes/kubernetes_git.bb              |  2 +-
 recipes-containers/nerdctl/nerdctl_git.bb     |  1 +
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 39 +++++++++++++++++++
 .../oci-image-tools/oci-image-tools_git.bb    |  5 ++-
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 33 ++++++++++++++++
 .../oci-runtime-tools_git.bb                  |  2 +
 recipes-containers/podman/podman_git.bb       |  4 +-
 recipes-containers/runc/runc.inc              |  1 +
 recipes-containers/skopeo/skopeo_git.bb       |  2 +-
 recipes-containers/umoci/umoci_git.bb         |  4 +-
 recipes-networking/cni/cni_git.bb             |  4 +-
 18 files changed, 138 insertions(+), 10 deletions(-)
 create mode 100644 recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch
 create mode 100644 recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
 create mode 100644 recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/15 docker-compose: set go buildid to empty for improving reproducibility

From: Changqing Li <[email protected]>

---
 recipes-containers/docker-compose/docker-compose_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-containers/docker-compose/docker-compose_git.bb +2 -2
index ccb36a16..443184c0 100644
@@ -61,7 +61,7 @@ do_compile() {
 	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 
-	GO_LDFLAGS="-s -w -X internal.Version=${PV} -X ${COMPOSE_PKG}/internal.Version=${PV}"
+	GO_LDFLAGS="-s -w -X internal.Version=${PV} -X ${COMPOSE_PKG}/internal.Version=${PV} -buildid="
 	GO_BUILDTAGS=""
 	mkdir -p ./bin
 	${GO} build ${GOBUILDFLAGS} -tags "$GO_BUILDTAGS" -ldflags "$GO_LDFLAGS" -o ./bin/docker-compose ./cmd
@@ -85,4 +85,4 @@ INSANE_SKIP:${PN} += "ldflags already-stripped"
 
 # the AWS dependency is 8GB, try and control the
 # size of the clones
-BB_GIT_SHALLOW = "1"
\ No newline at end of file
+BB_GIT_SHALLOW = "1"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/15 docker: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/docker/docker.inc | 2 ++
 1 file changed, 2 insertions(+)
recipes-containers/docker/docker.inc +2 -0
index 99535a77..8da12aa6 100644
@@ -89,6 +89,7 @@ do_compile() {
 
 	export DISABLE_WARN_OUTSIDE_CONTAINER=1
 	export BUILDFLAGS="-trimpath"
+	export DOCKER_LDFLAGS="-buildid="
 
 	cd ${S}/src/import/
 
@@ -103,6 +104,7 @@ do_compile() {
 	export LDFLAGS=""
 	export DOCKER_VERSION=${DOCKER_VERSION}
 	export BUILDFLAGS="-trimpath"
+	export GO_LDFLAGS="-buildid="
 	VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${DOCKER_COMMIT}" make dynbinary
 }
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/15 kubernetes: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/kubernetes/kubernetes_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/kubernetes/kubernetes_git.bb +1 -1
index f7b6940a..527be7e0 100644
@@ -95,7 +95,7 @@ do_compile() {
 	export GOFLAGS="-trimpath"
 
 	# to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
-	make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" DBG=1
+	make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="-buildid=" DBG=1
 }
 
 do_install() {
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/15 nerdctl: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/nerdctl/nerdctl_git.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/nerdctl/nerdctl_git.bb +1 -0
index 8f63b48c..7c63f78e 100644
@@ -76,6 +76,7 @@ do_compile() {
         export GOARCH=${TARGET_GOARCH}
         export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
         export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+        export GO_BUILD_LDFLAGS="-s -w -buildid="
 
         # -trimpath removes build paths from the binary (required for reproducible builds)
         oe_runmake GO=${GO} BUILDTAGS="${BUILDTAGS}" GO_BUILD_FLAGS="-trimpath" binaries
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/15 runc: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/runc/runc.inc | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/runc/runc.inc +1 -0
index b834ab14..193701eb 100644
@@ -61,6 +61,7 @@ do_compile() {
 	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export GO=${GO}
+	export EXTRA_LDFLAGS="-buildid="
 
 	export CFLAGS=""
 	export LDFLAGS=""
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/15 skopeo: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/skopeo/skopeo_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/skopeo/skopeo_git.bb +1 -1
index 936d2c3d..c07ef6ed 100644
@@ -60,7 +60,7 @@ do_compile() {
 	export CGO_LDFLAGS="${TARGET_LDFLAGS}"
 
 	export GO111MODULE=off
-	export EXTRA_LDFLAGS="-s -w"
+	export EXTRA_LDFLAGS="-s -w -buildid="
 
 	oe_runmake bin/skopeo
 }
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/15 umoci: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/umoci/umoci_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-containers/umoci/umoci_git.bb +2 -2
index f148b7fa..e26b4ead 100644
@@ -50,7 +50,7 @@ do_compile:class-native () {
     # the executable (coredump)
     # https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
     # https://github.com/NixOS/patchelf/issues/146
-    oe_runmake umoci.static
+    oe_runmake umoci.static BASE_LDFLAGS="-s -w -X \${PROJECT}.gitCommit=\${COMMIT} -buildid="
 
     # so the common install can find our binary
     cp umoci.static umoci
@@ -73,7 +73,7 @@ do_compile() {
     export BUILD_FLAGS="-trimpath"
     cd ${S}
 
-    oe_runmake umoci
+    oe_runmake umoci BASE_LDFLAGS="-s -w -X \${PROJECT}.gitCommit=\${COMMIT} -buildid="
 }
 
 do_install() {
Signature · 1 line
2.34.1
#8 lore raw

PATCH 8/15 cni: update GO_EXTRA_LDFLAGS

In reply to [email protected]

From: Changqing Li <[email protected]>

Using GO_EXTRA_LDFLAGS to set BuildVersion, pass another -ldflags will overrides -ldflags set in GOBUILDFLAGS(set in go.bbclass)

---
 recipes-networking/cni/cni_git.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
recipes-networking/cni/cni_git.bb +3 -1
index 88f9b483..ca7b17a2 100644
@@ -55,6 +55,8 @@ BB_GIT_SHALLOW = "1"
 # https://github.com/llvm/llvm-project/issues/53999
 TOOLCHAIN = "gcc"
 
+GO_EXTRA_LDFLAGS += '-X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${CNI_VERSION}'
+
 do_compile() {
 	mkdir -p ${S}/src/github.com/containernetworking
 	ln -sfr ${S}/src/import ${S}/src/github.com/containernetworking/cni
@@ -91,7 +93,7 @@ do_compile() {
 	for p in $PLUGINS; do
 	    plugin="$(basename "$p")"
 	    echo "building: $p"
-	    ${GO} build -trimpath ${GOBUILDFLAGS} -ldflags '-X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${CNI_VERSION}' -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
+	    ${GO} build -trimpath ${GOBUILDFLAGS} -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
 	done
 
 	# Build flannel separately - it's from flannel-io/cni-plugin repo with its own module
Signature · 1 line
2.34.1
#9 lore raw

PATCH 9/15 oci-image-tools: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 39 +++++++++++++++++++
 .../oci-image-tools/oci-image-tools_git.bb    |  5 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch new file +39 -0
new file mode 100644
index 00000000..d946c342
@@ -0,0 +1,39 @@
+From 095e7a01a7d9f7a98650bc8a398daa291bf6d5d5 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Sun, 4 Jan 2026 17:24:31 +0800
+Subject: [PATCH] Makefile: add EXTRA_LDFLAGS
+
+add EXTRA_LDFLAGS to allow adding extra ldflags
+
+Upstream-Status: Submitted [https://github.com/opencontainers/image-tools/pull/243]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Makefile | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 1bfe021..8b92b93 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,6 +4,8 @@ BINDIR ?= $(DESTDIR)/usr/bin
+ COMMIT=$(shell git rev-parse HEAD 2> /dev/null || true)
+ EPOCH_TEST_COMMIT ?= $(shell git tag | tail -1)
+ 
++EXTRA_LDFLAGS ?= ""
++
+ default: all
+ 
+ help:
+@@ -27,7 +29,7 @@ check-license:
+ 
+ .PHONY: tool
+ tool:
+-	$(GO) build $(GOBUILDFLAGS) $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT}" -o oci-image-tool ./cmd/oci-image-tool
++	$(GO) build $(GOBUILDFLAGS) $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} ${EXTRA_LDFLAGS}" -o oci-image-tool ./cmd/oci-image-tool
+ 
+ 
+ all: tool man
+-- 
+2.34.1
+
recipes-containers/oci-image-tools/oci-image-tools_git.bb +4 -1
index 36026214..71b01a5b 100644
@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
 
 SRC_URI = "git://github.com/opencontainers/image-tools.git;branch=master;protocol=https;destsuffix=git/src/github.com/opencontainers/image-tools \
            file://0001-config-make-Config.User-mapping-errors-a-warning.patch \
-           file://0001-tool-respect-GO-and-GOBUILDFLAGS-when-building.patch"
+           file://0001-tool-respect-GO-and-GOBUILDFLAGS-when-building.patch \
+           file://0001-Makefile-add-EXTRA_LDFLAGS.patch"
 
 SRCREV = "11f9988298305d36f64248a6ee55318e60bf170b"
 PV = "1.0.0-rc3+git"
@@ -38,6 +39,8 @@ do_compile() {
 
 	export GOBUILDFLAGS="-trimpath"
 
+    export EXTRA_LDFLAGS="-buildid="
+
 	cd ${S}
 
 	oe_runmake tool
Signature · 1 line
2.34.1
#10 lore raw

PATCH 10/15 docker-distribution: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 .../docker-distribution_git.bb                |  2 +
 ...01-Makefile-remove-duplicate-ldflags.patch | 39 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch
recipes-containers/docker-distribution/docker-distribution_git.bb +2 -0
index 5e37fe74..90ad5680 100644
@@ -7,6 +7,7 @@ SRCREV_distribution = "76fe6170526f0a1046c340c20b041a090d8dbfc9"
 SRC_URI = "git://github.com/docker/distribution.git;branch=main;name=distribution;destsuffix=git/src/github.com/distribution/distribution/v3;protocol=https \
            file://docker-registry.service \
            file://0001-build-use-to-use-cross-go-compiler.patch \
+           file://0001-Makefile-remove-duplicate-ldflags.patch \
           "
 
 PACKAGES =+ "docker-registry"
@@ -36,6 +37,7 @@ do_compile() {
 	export CGO_LDFLAGS="${TARGET_LDFLAGS}"
 	export GO111MODULE=off
 	export GO_BUILD_FLAGS="-trimpath"
+    export EXTRA_LDFLAGS="-buildid="
 
 	cd ${S}
 
recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch new file +39 -0
new file mode 100644
index 00000000..5f01e0b8
@@ -0,0 +1,39 @@
+From 06af6fa59fc39e15aac8f57f2c9f0b87a47ef125 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Sun, 4 Jan 2026 17:30:46 +0800
+Subject: [PATCH] Makefile: remove duplicate ldflags
+
+The second ldflags will override the first one in GO_LDFLAGS, and make
+user cannot set GO_LDFLAGS by passing this variable
+
+Upstream-Status: Submitted [https://github.com/distribution/distribution/pull/4762]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d958e75..b987bb1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -60,14 +60,14 @@ version/version.go:
+ 
+ bin/%: cmd/% FORCE ## build individual binary
+ 	@echo "$(WHALE) $@${BINARY_SUFFIX}"
+-	@${GO} build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} --ldflags '-extldflags "-Wl,-z,now" -s' ${GO_TAGS}  ./$<
++	@${GO} build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS}  ./$<
+ 
+ binaries: $(BINARIES) ## build binaries
+ 	@echo "$(WHALE) $@"
+ 
+ build: ## build go packages
+ 	@echo "$(WHALE) $@"
+-	@go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${GO_LDFLAGS} --ldflags '-extldflags "-Wl,-z,now" -s' ${GO_TAGS} $(PACKAGES)
++	@go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${GO_LDFLAGS} ${GO_TAGS} $(PACKAGES)
+ 
+ image: ## build docker image IMAGE_NAME=<name>
+ 	docker buildx bake --set "*.tags=${IMAGE_NAME}" image-local
+-- 
+2.34.1
+
Signature · 1 line
2.34.1
#11 lore raw

PATCH 11/15 containerd: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/containerd/containerd_git.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/containerd/containerd_git.bb +1 -0
index 081cf354..79e288bf 100644
@@ -54,6 +54,7 @@ do_compile() {
     export CFLAGS="${CFLAGS}"
     export LDFLAGS="${LDFLAGS}"
     export SHIM_CGO_ENABLED="${CGO_ENABLED}"
+    export EXTRA_LDFLAGS="-buildid="
     # fixes:
     # cannot find package runtime/cgo (using -importcfg)
     #        ... recipe-sysroot-native/usr/lib/aarch64-poky-linux/go/pkg/tool/linux_amd64/link:
Signature · 1 line
2.34.1
#12 lore raw

PATCH 12/15 cri-o: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/cri-o/cri-o_git.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-containers/cri-o/cri-o_git.bb +1 -0
index 0932658c..49662ebc 100644
@@ -67,6 +67,7 @@ EXTRA_OEMAKE += "GO_TEST='${GO} test -trimpath -buildmode=pie'"
 do_compile() {
 	set +e
 
+	export EXTRA_LDFLAGS="-buildid="
 	cd ${S}/src/import
 
 	oe_runmake local-cross
Signature · 1 line
2.34.1
#13 lore raw

PATCH 13/15 cri-tools: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 recipes-containers/cri-tools/cri-tools_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/cri-tools/cri-tools_git.bb +1 -1
index dad675e8..4710c679 100644
@@ -57,7 +57,7 @@ do_compile() {
 	export CC="${CC}"
 	export LD="${LD}"
 	export GOBIN=""
-
+	export GO_LDFLAGS="-buildid="
 	oe_runmake crictl
 }
 
Signature · 1 line
2.34.1
#14 lore raw

PATCH 14/15 oci-runtime-tools: set go buildid to empty for improving reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

---
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 33 +++++++++++++++++++
 .../oci-runtime-tools_git.bb                  |  2 ++
 2 files changed, 35 insertions(+)
 create mode 100644 recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch new file +33 -0
new file mode 100644
index 00000000..59ae82c5
@@ -0,0 +1,33 @@
+From c8ceb663f7e27a786714d31abeb8da7e1e3d0984 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Wed, 7 Jan 2026 15:48:37 +0800
+Subject: [PATCH] Makefile: add EXTRA_LDFLAGS
+
+Add EXTRA_LDFLAGS to support add extra ldflags
+
+Upstream-Status: Submitted [https://github.com/opencontainers/runtime-tools/pull/803]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Makefile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e79aa74..2827f54 100644
+--- a/Makefile
++++ b/Makefile
+@@ -6,8 +6,9 @@ BUILDTAGS=
+ RUNTIME ?= runc
+ COMMIT ?= $(shell git describe --dirty --long --always --tags 2> /dev/null)
+ VERSION := ${shell cat ./VERSION}
+-BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" $(EXTRA_FLAGS)
+-STATIC_BUILD_FLAGS := -tags "$(BUILDTAGS) netgo osusergo" -ldflags "-extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" $(EXTRA_FLAGS)
++EXTRA_LDFLAGS ?= ""
++BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) ${EXTRA_LDFLAGS}" $(EXTRA_FLAGS)
++STATIC_BUILD_FLAGS := -tags "$(BUILDTAGS) netgo osusergo" -ldflags "-extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) ${EXTRA_LDFLAGS}" $(EXTRA_FLAGS)
+ VALIDATION_TESTS ?= $(patsubst %.go,%.t,$(shell find ./validation/ -name *.go | grep -v util))
+ 
+ all: tool runtimetest validation-executables
+-- 
+2.34.1
+
recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb +2 -0
index 81f51f9c..60c54ea8 100644
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b355a61a394a504dacde901c958f662c"
 
 SRC_URI = "git://github.com/opencontainers/runtime-tools.git;branch=master;protocol=https;destsuffix=git/src/github.com/opencontainers/runtime-tools \
            file://0001-build-use-for-cross-compiler.patch \
+           file://0001-Makefile-add-EXTRA_LDFLAGS.patch \
            "
 
 SRCREV = "0105384f68e16803891d0a17d9067b1def6a2778"
@@ -39,6 +40,7 @@ do_compile() {
 	#        cannot open file : open : no such file or directory
 	# export GO_BUILD_FLAGS="-a -pkgdir dontusecurrentpkgs"
 	export EXTRA_FLAGS="-trimpath"
+	export EXTRA_LDFLAGS="-buildid="
 
 	cd ${S}
 
Signature · 1 line
2.34.1
#15 lore raw

PATCH 15/15 podman: improve reproducibility

In reply to [email protected]

From: Changqing Li <[email protected]>

* set go buildid to empty for improving reproducibility
* set -buildvcs=false to improve reproducibility. do_compile will generate several binaries, when -buildvcs=true, check with command "go
version -m binray", some binraies with vcs.modified=false and clean mod version, some binaries with vcs.modified=true, and mod version append with "+dirty", and the result is random. But actually, the git tree is clean. It seems go have a different way to define clean repo. Just disable buildvcs for improving reproducibility

---
 recipes-containers/podman/podman_git.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
recipes-containers/podman/podman_git.bb +3 -1
index f09e01f8..06d1f3df 100644
@@ -48,7 +48,7 @@ export LDFLAGS = ""
 TOOLCHAIN = "gcc"
 
 # podmans Makefile expects BUILDFLAGS to be set but go.bbclass defines them in GOBUILDFLAGS
-export BUILDFLAGS = "${GOBUILDFLAGS}"
+export BUILDFLAGS = "${GOBUILDFLAGS} -buildvcs=false"
 
 inherit go goarch
 inherit container-host
@@ -91,6 +91,8 @@ do_compile() {
 	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 
+	export EXTRA_LDFLAGS="-buildid="
+
 	# podman now builds go-md2man and requires the host/build details
 	export NATIVE_GOOS=${BUILD_GOOS}
 	export NATIVE_GOARCH=${BUILD_GOARCH}
Signature · 1 line
2.34.1
#16 lore raw
In reply to [email protected]
Quoted 7 lines · Changqing Li via lists.yoctoproject.org

From: Changqing Li <[email protected]>

These series of patches are mostly set buildid to empty for improving reproducibility, I also send a patch to oe-core with subject:
[PATCH V3] go.bbclass: set buildid to empty string to improve reproducibility

Quoted 5 lines

which add -buildid= in default GO_LDFLAGS, but since packages compiled with go may not use GO_LDFLAGS in go.bbclass, they can have their own Makefiles, define their own variables for passing ldflags, so change them one by one.

Rather than setting it to empty, I'd rather set it to a value that might be useful to us.

Perhaps the git hash we are building ? or the checksum of another set of files ?

Bruce

Quoted 63 lines

podman also disable buildvcs

Changqing Li (15):
docker-compose: set go buildid to empty for improving reproducibility
docker: set go buildid to empty for improving reproducibility
kubernetes: set go buildid to empty for improving reproducibility
nerdctl: set go buildid to empty for improving reproducibility
runc: set go buildid to empty for improving reproducibility
skopeo: set go buildid to empty for improving reproducibility
umoci: set go buildid to empty for improving reproducibility
cni: update GO_EXTRA_LDFLAGS
oci-image-tools: set go buildid to empty for improving reproducibility
docker-distribution: set go buildid to empty for improving
reproducibility
containerd: set go buildid to empty for improving reproducibility
cri-o: set go buildid to empty for improving reproducibility
cri-tools: set go buildid to empty for improving reproducibility
oci-runtime-tools: set go buildid to empty for improving
reproducibility
podman: improve reproducibility

 .../containerd/containerd_git.bb              |  1 +
 recipes-containers/cri-o/cri-o_git.bb         |  1 +
 recipes-containers/cri-tools/cri-tools_git.bb |  2 +-
 .../docker-compose/docker-compose_git.bb      |  4 +-
 .../docker-distribution_git.bb                |  2 +
 ...01-Makefile-remove-duplicate-ldflags.patch | 39 +++++++++++++++++++
 recipes-containers/docker/docker.inc          |  2 +
 .../kubernetes/kubernetes_git.bb              |  2 +-
 recipes-containers/nerdctl/nerdctl_git.bb     |  1 +
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 39 +++++++++++++++++++
 .../oci-image-tools/oci-image-tools_git.bb    |  5 ++-
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 33 ++++++++++++++++
 .../oci-runtime-tools_git.bb                  |  2 +
 recipes-containers/podman/podman_git.bb       |  4 +-
 recipes-containers/runc/runc.inc              |  1 +
 recipes-containers/skopeo/skopeo_git.bb       |  2 +-
 recipes-containers/umoci/umoci_git.bb         |  4 +-
 recipes-networking/cni/cni_git.bb             |  4 +-
 18 files changed, 138 insertions(+), 10 deletions(-)
 create mode 100644
recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch
 create mode 100644
recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
 create mode 100644

recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch

--
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#9531):
https://lists.yoctoproject.org/g/meta-virtualization/message/9531
Mute This Topic: https://lists.yoctoproject.org/mt/117148688/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
#17 lore raw
Quoted 20 lines · Bruce Ashfield

**
*CAUTION: This email comes from a non Wind River email account!*
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, Jan 8, 2026 at 1:26 AM Changqing Li via lists.yoctoproject.org <https://urldefense.com/v3/__http://lists.yoctoproject.org__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMGHw_79Q$> <changqing.li <https://urldefense.com/v3/__http://changqing.li__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMuaHYLRg$>[email protected]> wrote:

From: Changqing Li <[email protected]>

These series of patches are mostly set buildid to empty for improving reproducibility, I also send a patch to oe-core with subject:
[PATCH V3] go.bbclass: set buildid to empty string to improve reproducibility

which add -buildid= in default GO_LDFLAGS, but since packages compiled with go may not use GO_LDFLAGS in go.bbclass, they can have their own Makefiles, define their own variables for passing ldflags, so change them one by one.

Quoted 5 lines

Rather than setting it to empty, I'd rather set it to a value that might be useful to us.

Perhaps the git hash we are building ? or the checksum of another set of files ?

Hi, Bruce

The idea is good, for the recipes changed one by one in this series patch, maybe we can easily give them a value one by one.

but for go.bbclass, I have two ideas:

GO_BUILDID ?= ' -buildid="${@d.getVar('SRCREV') if d.getVar('SRCREV') != 'INVALID' else ( d.getVar('SRCREV_%s'%${PN}) if d.getVar('SRCREV_%s'%${PN}) != '' else ( d.getVarFlag('SRC_URI', 'sha256sum') if d.getvarflag('sha256sum') != '' if () else '') )}'

This is complicated, andtheoretically speaking, not sure it always have a value. And do we really need this value, how to use it?

GO_BUILDID ?= ' -buildid=d.getVar('PV')

This can ensure it always have a value, but I think this is not very useful. usually, we can get version by "binray --version".

Consider above, how about set it to empty if we don't have special usage of this buildid?

//Sandy

Quoted 112 lines

Bruce

    podman also disable buildvcs

    Changqing Li (15):
      docker-compose: set go buildid to empty for improving
    reproducibility
      docker: set go buildid to empty for improving reproducibility
      kubernetes: set go buildid to empty for improving reproducibility
      nerdctl: set go buildid to empty for improving reproducibility
      runc: set go buildid to empty for improving reproducibility
      skopeo: set go buildid to empty for improving reproducibility
      umoci: set go buildid to empty for improving reproducibility
      cni: update GO_EXTRA_LDFLAGS
      oci-image-tools: set go buildid to empty for improving
    reproducibility
      docker-distribution: set go buildid to empty for improving
        reproducibility
      containerd: set go buildid to empty for improving reproducibility
      cri-o: set go buildid to empty for improving reproducibility
      cri-tools: set go buildid to empty for improving reproducibility
      oci-runtime-tools: set go buildid to empty for improving
        reproducibility
      podman: improve reproducibility

     .../containerd/containerd_git.bb
    <https://urldefense.com/v3/__http://containerd_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNo9zLiWA$>
                |  1 +
     recipes-containers/cri-o/cri-o_git.bb
    <https://urldefense.com/v3/__http://cri-o_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMs78D5Ig$>
           |  1 +
     recipes-containers/cri-tools/cri-tools_git.bb
    <https://urldefense.com/v3/__http://cri-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMpCb2ntg$>
    |  2 +-
     .../docker-compose/docker-compose_git.bb
    <https://urldefense.com/v3/__http://docker-compose_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN5gCwGXw$>
        |  4 +-
     .../docker-distribution_git.bb
    <https://urldefense.com/v3/__http://docker-distribution_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPPOSTQ1A$>
                  |  2 +
     ...01-Makefile-remove-duplicate-ldflags.patch | 39
    +++++++++++++++++++
     recipes-containers/docker/docker.inc
    <https://urldefense.com/v3/__http://docker.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNwIT0NzQ$> 
            |  2 +
     .../kubernetes/kubernetes_git.bb
    <https://urldefense.com/v3/__http://kubernetes_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOnhKFbpA$>
                |  2 +-
     recipes-containers/nerdctl/nerdctl_git.bb
    <https://urldefense.com/v3/__http://nerdctl_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNO5-GgCA$>
       |  1 +
     .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 39
    +++++++++++++++++++
     .../oci-image-tools/oci-image-tools_git.bb
    <https://urldefense.com/v3/__http://oci-image-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPoEWN6-w$>
      |  5 ++-
     .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 33 ++++++++++++++++
     .../oci-runtime-tools_git.bb
    <https://urldefense.com/v3/__http://oci-runtime-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOHvuIx5g$>
                    |  2 +
     recipes-containers/podman/podman_git.bb
    <https://urldefense.com/v3/__http://podman_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN_RLh2RA$>
         |  4 +-
     recipes-containers/runc/runc.inc
    <https://urldefense.com/v3/__http://runc.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN6fsNm5A$> 
                |  1 +
     recipes-containers/skopeo/skopeo_git.bb
    <https://urldefense.com/v3/__http://skopeo_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPMeA_sbQ$>
         |  2 +-
     recipes-containers/umoci/umoci_git.bb
    <https://urldefense.com/v3/__http://umoci_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUO9-Ps7rA$>
           |  4 +-
     recipes-networking/cni/cni_git.bb
    <https://urldefense.com/v3/__http://cni_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN-aL8Klg$>
               |  4 +-
     18 files changed, 138 insertions(+), 10 deletions(-)
     create mode 100644
    recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch
     create mode 100644
    recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
     create mode 100644
    recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch

    -- 
    2.34.1


    -=-=-=-=-=-=-=-=-=-=-=-
    Links: You receive all messages sent to this group.
    View/Reply Online (#9531):
    https://lists.yoctoproject.org/g/meta-virtualization/message/9531
    <https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/message/9531__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOR0VWQvA$>
    Mute This Topic:
    https://lists.yoctoproject.org/mt/117148688/1050810
    <https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/117148688/1050810__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUORBdhH5w$>
    Group Owner: [email protected]
    <mailto:meta-virtualization%[email protected]>
    Unsubscribe:
    https://lists.yoctoproject.org/g/meta-virtualization/unsub
    <https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/unsub__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNro6bbiw$>
    [[email protected]]
    -=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await 
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#18 lore raw
Quoted 39 lines · Changqing Li

On 1/8/26 21:21, Bruce Ashfield wrote:

*CAUTION: This email comes from a non Wind River email account!* Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, Jan 8, 2026 at 1:26 AM Changqing Li via lists.yoctoproject.org
<https://urldefense.com/v3/__http://lists.yoctoproject.org__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMGHw_79Q$>
<changqing.li
<https://urldefense.com/v3/__http://changqing.li__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMuaHYLRg$>

Quoted 7 lines · [email protected]> wrote:

From: Changqing Li <[email protected]>

These series of patches are mostly set buildid to empty for improving reproducibility, I also send a patch to oe-core with subject:
[PATCH V3] go.bbclass: set buildid to empty string to improve reproducibility

Quoted 5 lines

which add -buildid= in default GO_LDFLAGS, but since packages compiled with go may not use GO_LDFLAGS in go.bbclass, they can have their own Makefiles, define their own variables for passing ldflags, so change them one by one.

Rather than setting it to empty, I'd rather set it to a value that might be useful to us.

Perhaps the git hash we are building ? or the checksum of another set of files ?

Hi, Bruce

The idea is good, for the recipes changed one by one in this series patch, maybe we can easily give them a value one by one.

but for go.bbclass, I have two ideas:

Quoted 10 lines

GO_BUILDID ?= ' -buildid="${@d.getVar('SRCREV') if d.getVar('SRCREV') != 'INVALID' else ( d.getVar('SRCREV_%s'%${PN}) if d.getVar('SRCREV_%s'%${PN}) != '' else ( d.getVarFlag('SRC_URI', 'sha256sum') if d.getvarflag('sha256sum') != '' if () else '') )}'

This is complicated, and theoretically speaking, not sure it always have a value. And do we really need this value, how to use it?

GO_BUILDID ?= ' -buildid=d.getVar('PV')

This can ensure it always have a value, but I think this is not very useful. usually, we can get version by "binray --version".

It isn't about getting the version, it is about traceability in more of a CI/CD type environment
(and even in our layers where I don't bump by version, but use git hashes more often)

I view it similarly to the "latest" tag in containers. It is mainly useful in development and CI type
environments, but at release real tags are used when doing a container.

So capturing something about the build that is traceable and reproducible is my goal. The
SRCREV of the recipe we are building is the obvious choice, even though it is sometimes
captured in other places as well.

I don't mind your GO_BUILDID concept, even if it doesn't go to the main bbclass, we could
test it in meta-virt.

Bruce

Quoted 115 lines

Consider above, how about set it to empty if we don't have special usage of this buildid?

//Sandy

Bruce

Quoted 82 lines

podman also disable buildvcs

Changqing Li (15):
docker-compose: set go buildid to empty for improving reproducibility
docker: set go buildid to empty for improving reproducibility
kubernetes: set go buildid to empty for improving reproducibility
nerdctl: set go buildid to empty for improving reproducibility
runc: set go buildid to empty for improving reproducibility
skopeo: set go buildid to empty for improving reproducibility
umoci: set go buildid to empty for improving reproducibility
cni: update GO_EXTRA_LDFLAGS
oci-image-tools: set go buildid to empty for improving reproducibility
docker-distribution: set go buildid to empty for improving
reproducibility
containerd: set go buildid to empty for improving reproducibility
cri-o: set go buildid to empty for improving reproducibility
cri-tools: set go buildid to empty for improving reproducibility
oci-runtime-tools: set go buildid to empty for improving
reproducibility
podman: improve reproducibility

.../containerd/containerd_git.bb
<https://urldefense.com/v3/__http://containerd_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNo9zLiWA$>

            |  1 +
 recipes-containers/cri-o/cri-o_git.bb
<https://urldefense.com/v3/__http://cri-o_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMs78D5Ig$>
       |  1 +

recipes-containers/cri-tools/cri-tools_git.bb
<https://urldefense.com/v3/__http://cri-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMpCb2ntg$>
| 2 +-
.../docker-compose/docker-compose_git.bb
<https://urldefense.com/v3/__http://docker-compose_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN5gCwGXw$>

    |  4 +-
 .../docker-distribution_git.bb
<https://urldefense.com/v3/__http://docker-distribution_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPPOSTQ1A$>
              |  2 +
 ...01-Makefile-remove-duplicate-ldflags.patch | 39 +++++++++++++++++++
 recipes-containers/docker/docker.inc
<https://urldefense.com/v3/__http://docker.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNwIT0NzQ$>
        |  2 +
 .../kubernetes/kubernetes_git.bb
<https://urldefense.com/v3/__http://kubernetes_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOnhKFbpA$>
            |  2 +-
 recipes-containers/nerdctl/nerdctl_git.bb
<https://urldefense.com/v3/__http://nerdctl_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNO5-GgCA$>
   |  1 +
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 39 +++++++++++++++++++
 .../oci-image-tools/oci-image-tools_git.bb
<https://urldefense.com/v3/__http://oci-image-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPoEWN6-w$>
  |  5 ++-
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 33 ++++++++++++++++
 .../oci-runtime-tools_git.bb
<https://urldefense.com/v3/__http://oci-runtime-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOHvuIx5g$>
                |  2 +
 recipes-containers/podman/podman_git.bb
<https://urldefense.com/v3/__http://podman_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN_RLh2RA$>
     |  4 +-
 recipes-containers/runc/runc.inc
<https://urldefense.com/v3/__http://runc.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN6fsNm5A$>
            |  1 +
 recipes-containers/skopeo/skopeo_git.bb
<https://urldefense.com/v3/__http://skopeo_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPMeA_sbQ$>
     |  2 +-
 recipes-containers/umoci/umoci_git.bb
<https://urldefense.com/v3/__http://umoci_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUO9-Ps7rA$>
       |  4 +-
 recipes-networking/cni/cni_git.bb
<https://urldefense.com/v3/__http://cni_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN-aL8Klg$>
           |  4 +-
 18 files changed, 138 insertions(+), 10 deletions(-)
 create mode 100644
recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch
 create mode 100644
recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
 create mode 100644

recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch

--
2.34.1

Quoted 14 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#9531):
https://lists.yoctoproject.org/g/meta-virtualization/message/9531
<https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/message/9531__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOR0VWQvA$>
Mute This Topic: https://lists.yoctoproject.org/mt/117148688/1050810
<https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/117148688/1050810__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUORBdhH5w$>
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub
<https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/unsub__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNro6bbiw$>
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
#19 lore raw
Quoted 67 lines · Bruce Ashfield

**
*CAUTION: This email comes from a non Wind River email account!*
Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Wed, Jan 14, 2026 at 12:05 AM Changqing Li <[email protected]> wrote:

    On 1/8/26 21:21, Bruce Ashfield wrote:
Quoted 30 lines

**
*CAUTION: This email comes from a non Wind River email account!* Do not click links or open attachments unless you recognize the sender and know the content is safe.

On Thu, Jan 8, 2026 at 1:26 AM Changqing Li via lists.yoctoproject.org
<https://urldefense.com/v3/__http://lists.yoctoproject.org__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMGHw_79Q$>
<changqing.li
<https://urldefense.com/v3/__http://changqing.li__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMuaHYLRg$>[email protected]>
wrote:

From: Changqing Li <[email protected]>

These series of patches are mostly set buildid to empty for improving
reproducibility, I also send a patch to oe-core with subject:
[PATCH V3] go.bbclass: set buildid to empty string to improve reproducibility

which add -buildid= in default GO_LDFLAGS, but since packages compiled
with go may not use GO_LDFLAGS in go.bbclass, they can have their own
Makefiles, define their own variables for passing ldflags, so change
them one by one.

Quoted 6 lines

Rather than setting it to empty, I'd rather set it to a value that might
be useful to us.

Perhaps the git hash we are building ? or the checksum of another set of files ?

Hi, Bruce

The idea is good, for the recipes changed one by one in this series patch, maybe we can easily give them a value one by one.

but for go.bbclass, I have two ideas:

GO_BUILDID ?= ' -buildid="${@d.getVar('SRCREV') if d.getVar('SRCREV') != 'INVALID' else ( d.getVar('SRCREV_%s'%${PN}) if d.getVar('SRCREV_%s'%${PN}) != '' else ( d.getVarFlag('SRC_URI', 'sha256sum') if d.getvarflag('sha256sum') != '' if () else '') )}'

This is complicated, andtheoretically speaking, not sure it always have a value. And do we really need this value, how to use it?

GO_BUILDID ?= ' -buildid=d.getVar('PV')

This can ensure it always have a value, but I think this is not very useful. usually, we can get version by "binray --version".

It isn't about getting the version, it is about traceability in more of a CI/CD type environment (and even in our layers where I don't bump by version, but use git hashes more often)

I view it similarly to the "latest" tag in containers. It is mainly useful in development and CI type environments, but at release real tags are used when doing a container.

Quoted 6 lines

So capturing something about the build that is traceable and reproducible is my goal.  The SRCREV of the recipe we are building is the obvious choice, even though it is sometimes captured in other places as well.

I don't mind your GO_BUILDID concept, even if it doesn't go to the main bbclass, we could test it in meta-virt.

Thanks for explanation. Richard also don't like to set it to empty.  I will try to check if

if this can be resolved by patching go.  If it is not easy to patch,  then try to make

this GO_BUILDID concept better.

//Changqing

Quoted 131 lines

Bruce

Consider above, how about set it to empty if we don't have special usage of this buildid?

//Sandy

Quoted 115 lines
    Bruce


        podman also disable buildvcs

        Changqing Li (15):
          docker-compose: set go buildid to empty for improving
        reproducibility
          docker: set go buildid to empty for improving reproducibility
          kubernetes: set go buildid to empty for improving
        reproducibility
          nerdctl: set go buildid to empty for improving reproducibility
          runc: set go buildid to empty for improving reproducibility
          skopeo: set go buildid to empty for improving reproducibility
          umoci: set go buildid to empty for improving reproducibility
          cni: update GO_EXTRA_LDFLAGS
          oci-image-tools: set go buildid to empty for improving
        reproducibility
          docker-distribution: set go buildid to empty for improving
            reproducibility
          containerd: set go buildid to empty for improving
        reproducibility
          cri-o: set go buildid to empty for improving reproducibility
          cri-tools: set go buildid to empty for improving
        reproducibility
          oci-runtime-tools: set go buildid to empty for improving
            reproducibility
          podman: improve reproducibility

         .../containerd/containerd_git.bb
        <https://urldefense.com/v3/__http://containerd_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNo9zLiWA$>
                    |  1 +
         recipes-containers/cri-o/cri-o_git.bb
        <https://urldefense.com/v3/__http://cri-o_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMs78D5Ig$>
           |  1 +
         recipes-containers/cri-tools/cri-tools_git.bb
        <https://urldefense.com/v3/__http://cri-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMpCb2ntg$>
        |  2 +-
         .../docker-compose/docker-compose_git.bb
        <https://urldefense.com/v3/__http://docker-compose_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN5gCwGXw$>
            |  4 +-
         .../docker-distribution_git.bb
        <https://urldefense.com/v3/__http://docker-distribution_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPPOSTQ1A$>
                      |  2 +
         ...01-Makefile-remove-duplicate-ldflags.patch | 39
        +++++++++++++++++++
         recipes-containers/docker/docker.inc
        <https://urldefense.com/v3/__http://docker.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNwIT0NzQ$>
                |  2 +
         .../kubernetes/kubernetes_git.bb
        <https://urldefense.com/v3/__http://kubernetes_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOnhKFbpA$>
                    |  2 +-
         recipes-containers/nerdctl/nerdctl_git.bb
        <https://urldefense.com/v3/__http://nerdctl_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNO5-GgCA$>
         |  1 +
         .../0001-Makefile-add-EXTRA_LDFLAGS.patch  | 39
        +++++++++++++++++++
         .../oci-image-tools/oci-image-tools_git.bb
        <https://urldefense.com/v3/__http://oci-image-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPoEWN6-w$>
          |  5 ++-
         .../0001-Makefile-add-EXTRA_LDFLAGS.patch  | 33 ++++++++++++++++
         .../oci-runtime-tools_git.bb
        <https://urldefense.com/v3/__http://oci-runtime-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOHvuIx5g$>
                        |  2 +
         recipes-containers/podman/podman_git.bb
        <https://urldefense.com/v3/__http://podman_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN_RLh2RA$>
           |  4 +-
         recipes-containers/runc/runc.inc
        <https://urldefense.com/v3/__http://runc.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN6fsNm5A$>
                    |  1 +
         recipes-containers/skopeo/skopeo_git.bb
        <https://urldefense.com/v3/__http://skopeo_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPMeA_sbQ$>
           |  2 +-
         recipes-containers/umoci/umoci_git.bb
        <https://urldefense.com/v3/__http://umoci_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUO9-Ps7rA$>
           |  4 +-
         recipes-networking/cni/cni_git.bb
        <https://urldefense.com/v3/__http://cni_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN-aL8Klg$>
             |  4 +-
         18 files changed, 138 insertions(+), 10 deletions(-)
         create mode 100644
        recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch
         create mode 100644
        recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
         create mode 100644
        recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch

        -- 
        2.34.1


        -=-=-=-=-=-=-=-=-=-=-=-
        Links: You receive all messages sent to this group.
        View/Reply Online (#9531):
        https://lists.yoctoproject.org/g/meta-virtualization/message/9531
        <https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/message/9531__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOR0VWQvA$>
        Mute This Topic:
        https://lists.yoctoproject.org/mt/117148688/1050810
        <https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/117148688/1050810__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUORBdhH5w$>
        Group Owner: [email protected]
        <mailto:meta-virtualization%[email protected]>
        Unsubscribe:
        https://lists.yoctoproject.org/g/meta-virtualization/unsub
        <https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/unsub__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNro6bbiw$>
        [[email protected]]
        -=-=-=-=-=-=-=-=-=-=-=-



    -- 
    - Thou shalt not follow the NULL pointer, for chaos and madness
    await thee at its end
    - "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await 
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II